const Sequelize = require('sequelize')
const {BIGINT, STRING, DATE} = Sequelize

module.exports = (sequelize, Sequelize) => {
  const files = sequelize.define('files', {
    id: {
      type: BIGINT,
      primaryKey: true,
      autoIncrement: true
    },
    name: {
      type: STRING
    },
    type: {
      type: STRING
    },
    size: {
      type: STRING
    },
    create_date: {
      type: DATE
    },
    update_date: {
      type: DATE
    },
    path: {
      type: STRING
    }
  },{
    timestamp: true,
    underscored: true,
    createdAt: 'create_date',
    updatedAt: 'update_date',
  })

  return files
}